<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.org/schema/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" template="layout/template.xhtml"
	xmlns:pm="http://primefaces.org/mobile" contentType="text/html"
	renderKitId="PRIMEFACES_MOBILE">
	<ui:define name="body">
		<h:form id="meetingRoomBookingSearch">
			<pm:buttonGroup orientation="horizontal">
				<h:commandButton id="bookingSearch" value="预约检索"
					action="#{meetingRoomBookingListAction.bookingSearch}" />
				<h:commandButton id="search" value="检索"
					action="#{meetingRoomBookingListAction.search}" />
				<!--<s:button id="reset" value="Reset" includePageParams="false" />-->
				<s:button value="返回" action="cancel" />
			</pm:buttonGroup>
			<p:dataList type="inset" styleClass="ui-li-custom">
				<f:attribute name="swatch" value="e" />
				<f:attribute name="dividerSwatch" value="e" />
				<f:facet name="header">检索条件</f:facet>
				<p:outputPanel layout="block">
					<p:outputLabel for="mrType">会议室类型</p:outputLabel>
					<p:message for="mrType" />
					<h:inputText id="mrType"
						value="#{meetingRoomBooking.meetingRoom.mrType}" />
					<p:outputLabel for="mrName">会议室名称</p:outputLabel>
					<p:message for="mrName" />
					<h:inputText id="mrName"
						value="#{meetingRoomBooking.meetingRoom.mrName}" />
					<p:outputLabel for="meetingStartTime" styleClass="ui-input-text">预约开始时间</p:outputLabel>
					<p:message for="meetingStartTime" />
					<p:calendar id="meetingStartTime" required="true" stepMinute="10"
						locale="pt_BR" value="#{meetingRoomBooking.meetingStartTime}"
						pattern="yyyy/MM/dd HH:mm"
						timeZone="#{meetingRoomBookingListAction.timeZone}" />
					<p:outputLabel for="meetingEndTime" styleClass="ui-input-text">预约结束时间</p:outputLabel>
					<p:message for="meetingEndTime" />
					<p:calendar id="meetingEndTime" required="true" stepMinute="10"
						locale="pt_BR" value="#{meetingRoomBooking.meetingEndTime}"
						pattern="yyyy/MM/dd HH:mm"
						timeZone="#{meetingRoomBookingListAction.timeZone}" />
					<div data-role="none">
						<h:outputText value="*" style="color:red;" />
						required fields
					</div>
				</p:outputPanel>
			</p:dataList>
		</h:form>
		<h:form id="meetingRoomBookingList"
			rendered="#{!param['isBookingSearch']}">
			<p:dataList paginator="true" rows="10" value="#{meetingRoomBookings}"
				var="_meetingRoomBooking">
				<f:attribute name="swatch" value="e" />
				<f:attribute name="dividerSwatch" value="e" />
				<f:attribute name="paginatorText" value="更多.." />
				<f:facet name="header">预约信息检索结果</f:facet>
				<f:attribute name="filter" value="true" />
				<h:commandLink action="#{meetingRoomBookingListAction.showDetail}">
					<!--
          开始时间：
          <h:outputText value="#{_meetingRoomBooking.meetingStartTime}">
            <f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
          </h:outputText>
          结束时间：
          <h:outputText value="#{_meetingRoomBooking.meetingEndTime}">
            <f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
          </h:outputText>
          -->
					<h3>#{_meetingRoomBooking.meetingRoom.mrName}</h3>
					<p>
						<strong> 预约人： <h:outputText
								value="#{_meetingRoomBooking.bookingUserId}" />
						</strong>
					</p>
					<p>
						日期：
						<h:outputText value="#{_meetingRoomBooking.meetingStartTime}">
							<f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
						</h:outputText>
						<p:spacer height="15em" />
					</p>
					<p class="ui-li-aside">
						<h:outputText value="#{_meetingRoomBooking.meetingStartTime}">
							<f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
						</h:outputText>
						~
						<h:outputText value="#{_meetingRoomBooking.meetingEndTime}">
							<f:convertDateTime pattern="yyyy/MM/dd HH:mm" timeZone="CCT" />
						</h:outputText>
					</p>
				</h:commandLink>
				<p:commandLink action="#{meetingRoomBookingListAction.showDetail}">
					<f:attribute name="icon" value="edit" />
				</p:commandLink>
			</p:dataList>
			<p:spacer height="10em" />
		</h:form>
		<h:form id="meetingRoomList" rendered="#{param['isBookingSearch']}">
			<p:dataList paginator="true" rows="10" value="#{meetingRooms}"
				var="_meetingRoom">
				<f:attribute name="swatch" value="e" />
				<f:attribute name="dividerSwatch" value="e" />
				<f:attribute name="paginatorText" value="更多.." />
				<f:facet name="header">预约会议室检索结果</f:facet>
				<f:attribute name="filter" value="true" />
				<p:commandLink value="#{_meetingRoom.mrName}" action="booking">
					<f:setPropertyActionListener value="#{_meetingRoom.mrId}"
						target="#{meetingRoomBookingAction.meetingRoomDto.mrId}" />
				</p:commandLink>
			</p:dataList>
			<p:spacer height="10em" />
		</h:form>
	</ui:define>
</ui:composition>
